import request from '@/utils/request'

// 查询总代和代理账户列表
export function listMoney(query) {
  return request({
    url: '/agency/money/list',
    method: 'get',
    params: query
  })
}

// 运营数据
export function listYxsj(query) {
  return request({
    url: '/click/cnt/listYxsj',
    method: 'get',
    params: query
  })
}
// 代理数据
export function listDlsj(query) {
  return request({
    url: '/click/cnt/listDlsj',
    method: 'get',
    params: query
  })
}
// 金币产出
export function listJbcc(query) {
  return request({
    url: '/click/cnt/listJbcc',
    method: 'get',
    params: query
  })
}
export function sumJbcc(query) {
  return request({
    url: '/click/cnt/selectJbccSum',
    method: 'get',
    params: query
  })
}

// 查询总代和代理账户详细
export function getMoney(id) {
  return request({
    url: '/agency/money/' + id,
    method: 'get'
  })
}

export function getRandom() {
  return request({
    url: '/agency/money/getAgencyRandom',
    method: 'get'
  })
}

// 新增总代和代理账户
export function addMoney(data) {
  return request({
    url: '/agency/money',
    method: 'post',
    data: data
  })
}

// 修改总代和代理账户
export function updateMoney(data) {
  return request({
    url: '/agency/money',
    method: 'put',
    data: data
  })
}

//提现
export function txMoney(data) {
  return request({
    url: '/agency/money/tx',
    method: 'put',
    data: data
  })
}

// 删除总代和代理账户
export function delMoney(id) {
  return request({
    url: '/agency/money/' + id,
    method: 'delete'
  })
}
